package com.me.jingdongshop.ui.holder;

import android.content.Context;
import android.content.SharedPreferences;
import android.graphics.Color;
import android.support.annotation.Nullable;
import android.support.v4.widget.SwipeRefreshLayout;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.TextView;

import com.me.common.ui.BaseAdapterRV;
import com.me.common.ui.BaseHolderRV;
import com.me.jingdongshop.R;
import com.me.jingdongshop.model.bean.Category;
import com.me.jingdongshop.ui.activity.MainActivity;
import com.me.jingdongshop.ui.fragment.CategoryFragment;

import java.util.IdentityHashMap;
import java.util.IllegalFormatCodePointException;
import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * Created by Tm on 2017/4/28.
 */

public class GoodsCategoryHolder extends BaseHolderRV<Category.CategoryBean> {
    //颜色监听
    int color = 0;


    private TextView name;


    public GoodsCategoryHolder(Context context, ViewGroup parent, BaseAdapterRV<Category.CategoryBean> adapter, int itemType) {
        super(context, parent, adapter, itemType, R.layout.goods_type_lv_item);
    }

    @Override
    public void onFindViews(View itemView) {
        name = (TextView) itemView.findViewById(R.id.tv_gonds_type);

    }

    @Override
    protected void onRefreshView(Category.CategoryBean bean, int position) {

            name.setText(bean.getName());

    }

    @Override
    protected void onItemClick(View itemView, int position, Category.CategoryBean bean) {

        super.onItemClick(itemView, position, bean);

        color =position;


       //adapter.notifyDataSetChanged();

        CategoryFragment fragment1 = (CategoryFragment) ((MainActivity)super.context).getFragment();
        fragment1.dealEvent(position);

    }



}
